<template>
  <div class="top">
    <content>
      <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
        <van-swipe-item v-for="item in obj.pics" :key="item.id">
          <img :src="item.pic" alt />
        </van-swipe-item>
      </van-swipe>
      <div v-html='text'></div>
    </content>
    <van-goods-action>
  <van-goods-action-icon icon="chat-o" text="客服"  />
  <van-goods-action-icon icon="cart-o" text="购物车"  />
  <van-goods-action-icon icon="shop-o" text="店铺"  />
  <van-goods-action-button
    type="danger"
    text="立即购买"
  />
</van-goods-action>
  </div>
</template>
<script>
import Vue from "vue";
import { GoodsAction, GoodsActionIcon, GoodsActionButton } from "vant";

Vue.use(GoodsAction);
Vue.use(GoodsActionButton);
Vue.use(GoodsActionIcon);
import content from "../../components/center/center";
import "../../components/css/aa.css"
export default {
  data() {
    return {
      text:"",
      components: {
        content,
      },
      obj: [],
      
    };
  },

  mounted() {
    let id = this.$route.query.id;
    console.log(this.$route.query.id);
    this.$axios
      .get("https://api.it120.cc/small4/shop/goods/detail", {
        params: {
          id: id,
        },
      })
      .then((res) => {
        console.log(res);
        this.obj = res.data.data;
          this.text = res.data.data.content;
      });
  },
};
</script>
<style lang="scss">
.top {
  margin-top: 10vh;
  overflow: hidden;
}
</style>